package org.chuan.hisports.service.Imp;

import org.chuan.hisports.dao.UserInfoDao;
import org.chuan.hisports.entity.UserInfo;
import org.chuan.hisports.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserInfoServiceImp implements UserInfoService
{
    @Autowired
    UserInfoDao userInfoDao;
    @Override
    public UserInfo select(String uid) {
        UserInfo userInfo = userInfoDao.select(uid);
        return userInfo;
    }

    @Override
    public String CheckUpOrIn(UserInfo userInfo) {
        if (userInfo.getId() != null){
            userInfoDao.update(userInfo);
            return "更新成功";
        }else{
            userInfoDao.insert(userInfo);
            return "创建成功";
        }

    }
}
